Window.prototype.$on = function (key, method) {
    if (!this._eventBus) { this._eventBus = {} }
    if (!this._eventBus[key]) { this._eventBus[key] = [] }
    this._eventBus[key].push(method)
}
Window.prototype.$emit = function (key, ...args) {
    if (!this._eventBus || !this._eventBus[key]) return
    if (this._eventBus[key].length === 0) return

    this._eventBus[key].forEach(method => method(...args))
}

const W_Selectable_CallHandler = Window_Selectable.prototype.callHandler
Window_Selectable.prototype.callHandler = function(symbol) {
    W_Selectable_CallHandler.call(this,...arguments)
    
    if(this.isHandled(symbol)){
        this.$emit(symbol)
    }
};